<extend name="Public/header" />
<block name="main">
<div class="panel panel-default">
                        <div class="panel-heading">
                            DataTables Advanced Tables
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div id="dataTables-example_wrapper" class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                                <div class="row">
                                    <form role="form" action="{:U('index')}" method="get" enctype="multipart/form-data">
                                    <div class="col-sm-6">
                                        <div class="form-group">
                                            <label>商家</label>
                                            <select name="bid" class="form-control">
                                                <option value="">请选择</option>
                                                <foreach name="list" item="val">
                                                    <option value="{$val.id}">{$val.name}</option>
                                                </foreach>
                                            </select>
                                        </div>
                                      </div>
                                    <div class="form-group input-group">
                                    <input type="text" class="form-control" name="selname" value="关键字">
                                        <span class="input-group-btn">
                                                <button type="submit" class="btn btn-default" ><i class="fa fa-search"></i>
                                                </button>
                                            </span>
                                    </div>
                                    </form>
                                    </div>
                                <br>
                                    <div class="row">
                                        <div class="col-sm-12">
                                <table width="100%" class="table table-striped table-bordered table-hover dataTable no-footer dtr-inline" id="" role="grid" aria-describedby="dataTables-example_info" style="width: 100%;">
                                           <thead>
                                 <tr>
                                            <th>No.</th>
                                            <th>图片</th>
                                            <th>商家</th>
                                            <th>商品</th>
                                            <th>排名</th>
                                            <th>点击数量</th>
                                            <th>开始时间</th>
                                            <th>结束时间</th>
                                            <th>添加时间</th>
                                            <th>状态</th>
                                            <th>操作</th>
                              </tr>
                                </thead>
                                <tbody>
                    <foreach name="data" item="v">
                        <tr>
                            <td>{$v.id}</td>
                            <td><img src="__ROOT__{$v.img}" width="120px" heigt="60px"></td>
                            <td>{$v.bname}</td>
                            <td>{$v.name}</td>
                            <td>{$v.cnum}</td>
                            <td>{$v.ranking}</td>
                            <td>{:date('Y-m-d',$v['start'])}</td>
                            <td>{:date('Y-m-d',$v['stop'])}</td>
                            <td>{:date('Y-m-d H:i:s',$v['time'])}</td>
                            <td class="center">{$v['state']==1?'显示':'隐藏'}</td>
                                <td class="center">
                                    <a href="{:U('Lunbo/show',array('val'=>$v['state'],id=>$v['id']))}" class="btn btn-outline btn-success"> {$v['state']==1?'显示':'隐藏'}</a>
                                    <a href="{:U('Lunbo/edit',array(id=>$v['id']))}" class="btn btn-outline btn-primary">编辑</a>
                                    <a href="{:U('Lunbo/del',array(id=>$v['id']))}" class="btn btn-outline btn-danger">删除</a>
                                </td>
                        </tr>
                    </foreach>
                    </tbody>
                            </table>
                        </div>
                    </div>
                                <div class="row"><div class="col-sm-6"></div>
                                    <div class="col-sm-6">
                                        <div class="dataTables_paginate paging_simple_numbers" id="dataTables-example_paginate">
                                            <div class="pages" style="margin: 0px auto;text-align: center;">
                                                {$page}
                                            </div>
                                        </div>
                                    </div>
                                </div>


                            <!-- /.table-responsive -->
                        
                        </div>
                        <!-- /.panel-body -->
                    </div>
</block>